package day1107.demo01;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/7 9:34
 */

public class Test {
    public static void main(String[] args) {

        //日期时间转化为字符串
        LocalDateTime now = LocalDateTime.now();
        System.out.println("now = " + now);
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String format = now.format(dateTimeFormatter);
        System.out.println("format = " + format);


    }
}
